import groovy.sql.Sql

//def url = 'jdbc:sqlite::memory:'
def url = 'jdbc:sqlite:Q:\\TEMP\\test.sqlite'
def user = ''
def password = ''
def driver = 'org.sqlite.JDBC'
def sql = Sql.newInstance(url, user, password, driver)

sql.execute("CREATE TABLE \"keyword\" (\n" +
        "  \"ID\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n" +
        "  \"keyword\" TEXT,\n" +
        "  \"wordType\" TEXT,\n" +
        "  \"weight\" integer\n" +
        ");")
sql.execute("CREATE TABLE \"fileList\" (\n" +
        "  \"filePath\" text,\n" +
        "  \"fileName\" text,\n" +
        "  \"fileSize\" integer,\n" +
        "  \"filePathMd5\" text,\n" +
        "  \"fileMd5\" text,\n" +
        "  \"ID\" integer NOT NULL PRIMARY KEY AUTOINCREMENT\n" +
        ");")

sql.execute("CREATE TABLE \"keywork2file\" (\n" +
        "  \"keywordId\" INTEGER NOT NULL,\n" +
        "  \"fileId\" INTEGER,\n" +
        "  \"weight\" integer,\n" +
        "  \"fileMd5\" TEXT,\n" +
        "  \"filePathMd5\" TEXT,\n" +
        "  \"ID\" integer NOT NULL PRIMARY KEY AUTOINCREMENT\n" +
        ");")


//sql.execute("""INSERT INTO fileList(filePath,fileName,fileSize,filePathMd5,fileMd5,ID) VALUES('path', 'name',10000,'aaaaa','ssssss','uuid' ) """)

sql.close()